package com.yuantu.judiciary.controller;

import com.yuantu.judiciary.common.Response;
import com.yuantu.judiciary.common.ResponseFactory;
import com.yuantu.judiciary.model.dto.AccountInfoDTO;
import com.yuantu.judiciary.model.enums.EndpointType;
import com.yuantu.judiciary.model.form.AddFeedbackForm;
import com.yuantu.judiciary.service.ISysFeedbackService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 反馈模块
 *
 * @author syw
 * @since 2023-08-17
 **/
@RestController
@RequestMapping("/feedback")
@Api(tags = "反馈模块")
@RequiredArgsConstructor
public class SysFeedbackController extends BaseController{

    private final ISysFeedbackService feedbackService;


    //todo 添加反馈
    @ApiOperation(value = "添加反馈")
    @PostMapping("/add")
    public Response<Boolean> add(@RequestBody @Validated AddFeedbackForm form) {
        AccountInfoDTO account = getLoginAccount();
        return ResponseFactory.okResponse(feedbackService.add(form, account));
    }



}
